<?php

namespace App\Http\ControllersVer1;

use Illuminate\Http\Request;

class ExampleController extends Controller
{
    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    //


    public function test() {


        return response()->json([
            'code' => 2000,
            'msg' => 'api v1 test success!'
        ]);

    }


    public function pst(Request $request) {

        $this->validate($request, [
            'nickname' => 'required|max:10'
        ]);

        $nickname = $request->input('nickname');

        return response()->json([
            'code' => 2000,
            'nickname' => $nickname,
            'msg' => 'success!'
        ]);

    }



}
